package com.logistics.modules.transportationManagement.dao;
import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logistics.modules.transportationManagement.chart.KeyAndValueChart;
import com.logistics.modules.transportationManagement.entity.MoveplanEntity;
import com.logistics.modules.transportationManagement.entity.VehiclemoveorderEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 
 * 
 * @author HURRICANE
 * @email HURRICANE@nb.com
 * @date 2022-05-06 18:12:10
 */
@Mapper
public interface VehiclemoveorderDao extends BaseMapper<VehiclemoveorderEntity> {

    /**
     * 分页查询页面
     *
     * @param page 页面
     * @return {@link IPage}<{@link MoveplanEntity}>
     */
    IPage<MoveplanEntity> quaryPage(@Param("page") IPage<VehiclemoveorderEntity> page,
                                    @Param("vehicleName") String vehicleName,
                                    @Param("vehicleTypeId") Integer vehicleTypeId,
                                    @Param("startAddress") String startAddress,
                                    @Param("endAddress") String endAddress,
                                    @Param("transportationStatus") Integer transportationStatus);

    int updateStatusById(@Param("status") Integer status, @Param("id") Integer id);

    /**
     * 选择一个通过id
     *
     * @param id id
     * @return {@link VehiclemoveorderEntity}
     */
    VehiclemoveorderEntity selectOneById(@Param("id") Integer id);

    /**
     * 分页查询页面
     *
     * @param page 页面
     * @return {@link IPage}<{@link MoveplanEntity}>
     */
    IPage<MoveplanEntity> queryPageListByStatus(@Param("page") IPage<VehiclemoveorderEntity> page,
                                    @Param("vehicleName") String vehicleName,
                                    @Param("vehicleTypeId") Integer vehicleTypeId,
                                    @Param("startAddress") String startAddress,
                                    @Param("endAddress") String endAddress);

    int updateSelective(VehiclemoveorderEntity vehiclemoveorderEntity);

    int updateTotalMileageById(@Param("totalMileage") Double totalMileage, @Param("id") Integer id);

    /**
     * 根据车牌号分局查询总里程
     */
    List<KeyAndValueChart> selectTotalMileageByVehicleNumber();

    /**
     * 拿到所有的月份
     */
    List<String> selectMonth();

    /**
     * 根据车牌号查询每月的车辆里程
     */
    List<String> selectMonthMileageByVehicleNumber(@Param("vehicleNumber") String vehicleNumber);
}
